package com.ykht.proj.coupon.vo;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

@Data
@ToString
public class BaseSearchTimeVo {

	@ApiModelProperty("时间偏移量，昨天：-1，近7天：-6")
	private Integer offsetDay;
	@ApiModelProperty("开始时间")
	private LocalDateTime startTime;
	@ApiModelProperty("结束时间")
	private LocalDateTime endTime;

/*
	public void setOffsetDay(Integer offsetDay) {
		if (offsetDay>0) offsetDay=0;
		this.offsetDay = offsetDay;
		switch (offsetDay){
			case -1:
				this.setStartTime(LocalDateTime.of(LocalDate.now().plusDays(offsetDay), LocalTime.MIN));
				this.setEndTime(LocalDateTime.of(LocalDate.now().plusDays(offsetDay), LocalTime.MAX));
				break;
			default:
				this.setStartTime(LocalDateTime.of(LocalDate.now().plusDays(offsetDay), LocalTime.MIN));
				this.setEndTime(LocalDateTime.now());
				break;
		}
	}
*/

	/*public static void main(String[] args) {
		LocalDateTime startTime = LocalDateTime.of(LocalDate.now().plusDays(-1), LocalTime.MAX);
		LocalDateTime startTime1 = LocalDateTime.now().plusDays(-1);
		LocalDateTime startTime2 = LocalDateTime.now();
		System.out.println(startTime);
		System.out.println(LocalTime.MIDNIGHT);
		System.out.println(LocalTime.MAX);
		System.out.println(LocalTime.MIN);
		System.out.println(LocalTime.NOON);
		BaseSearchTimeVo vo = new BaseSearchTimeVo();
		vo.setOffsetDay(0);
		System.out.println(vo);
	}*/
}
